import request from "@/utils/request.js";

export function getAllItem(query){
    return request({
        url:'/experiment/experiment/item/list',
        method:'get',
        params:query
    })
}

export function listSample(query){
    return request({
        url:'/experiment/experiment/sample',
        method:'get',
        params:query
    })
}
export function callSamples(list){
    return request({
        url:'/experiment/experiment/sample/call',
        method:'post',
        data:list
    })
}

// 新增实验管理
export function addDetail(data) {
    return request({
        url: '/experiment/experiment',
        method: 'post',
        data: data
    })
}

// 修改实验管理
export function updateDetail(data) {
    return request({
        url: '/experiment/experiment',
        method: 'put',
        data: data
    })
}

// 删除实验管理
export function delDetail(sampleId) {
    return request({
        url: '/experiment/experiment/' + sampleId,
        method: 'delete'
    })
}

// 查询实验类型列表
export function listAllExperiment() {
    return request({
        url: '/experiment/experimentType/listall',
        method: 'get'
    })
}
//流转消息
export function postFlume(data){
    return request({
        url:'/experiment/experiment/flume',
        method:'post',
        data:data
    })
}
//获取未流转实验分发人的实验
export function getNoFlumeExperiments(ids){
    return request({
        url:'experiment/experiment/getNoFlumeExperiments',
        method:'post',
        data:ids,
    })
}
//获取未流转项目负责人的实验
export function getNoFlumeProjects(ids){
    return request({
        url:'experiment/experiment/getNoFlumeProjects',
        method:'post',
        data:ids,
    })
}

// 查询实验管理详细(已弃用)
// export function getDetail(experimentId) {
//     return request({
//         url: '/experiment/experiment/' + experimentId,
//         method: 'get'
//     })
// }

//查询该样品是否已经添加实验
export function getExperimentBySampleId(sampleId){
    return request({
        url:'/experiment/experiment/'+sampleId,
        method:'get'
    })
}
//根据id查询样品
export function getSampleById(sampleId){
    return request({
        url:'/experiment/experiment/samplebyid?id='+sampleId,
        method:'get'
    })
}
